-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layering items and item variants on specific furniture and terrain #52632
Merged
kevingranade
merged 11 commits into
CleverRaven:master
from
bombasticSlacks:layeringjson
Nov 12, 2021
Merged
Layering items and item variants on specific furniture and terrain #52632
kevingranade
merged 11 commits into
CleverRaven:master
from
bombasticSlacks:layeringjson
Nov 12, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I've guessed on the label here. Let me know if I need to change it. |
BrettDong
reviewed
Nov 5, 2021
bombasticSlacks
changed the title
[WIP]Layering items and item variants on specific furniture and terrain
Layering items and item variants on specific furniture and terrain
Nov 5, 2021
Saicchi
pushed a commit
to Saicchi/Cataclysm-DDA
that referenced
this pull request
Nov 13, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[C++]
Changes (can be) made in C++. Previously named `Code`
SDL: Tiles / Sound
Tiles visual interface and sounds.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Content "Layering items and item variants on specific furniture and terrain"
Purpose of change
fixes #52616
Describe the solution
Implements a new unsorted map per tileset that reads from a file called layering.json if it is available and stores additional info for the tile to layer items when doing render calls. #52616 more clearly explains the what and why.
I believe this now works correctly and renders as would be expected
Describe alternatives you've considered
A few details of implementation could be modified. For displaying weighted overlays consistently I've added a random seed per item. That could instead be per tile, furniture piece etc.
Somehow I'm sure this could be coupled more deeply into the data / json but since it is tileset specific I think it should live there.
Testing
Load up the game, build a desk, put a laptop and a pen on the desk.
use this ultica_custom that contains mock ups to test the functionality
ultica_custom.zip
Additional context
Here are some tests using mockup layering sprites I have a single laptop layer sprite and 2 pen sprites. There is an equal chance a pen will be the left side or right side sprite. (for mockup purposes only one has the black underline usual to Ultica):
Just drawing laptops and pens on top of the desk even at a distance:
You get the highlight for additional items when close enough to see in the container:
If the topmost item is not already been rendered as a layer sprite it will also draw on the tile as normal (in this case a combat knife):